/*
 * block.h -- this file is part of mISPL.
 * Copyright (C) 2011 Christian Krause
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
#ifndef BLOCK_H_
#define BLOCK_H_

#include "sequence.h"

/*** Block data type ***/
typedef struct __block __block_s;
typedef __block_s* block_t;
struct __block {
	int maxcols;
	int maxrows;
	int rowcount;
	int period;
	sequence_t* rows;
	hashcode_t* rowhashs;
};

block_t		block_init(int maxcols, int maxrows);
void		block_clear(block_t block);
void		block_reset(block_t block);
bool_t		block_contains_row(block_t block, sequence_t row, hashcode_t hashcode);
bool_t		block_add_row(block_t block, sequence_t row, hashcode_t hashcode);
sequence_t	block_get_column(block_t block, int col);

#endif /* BLOCK_H_ */
